<!--
 * @Descripttion: 
 * @version: 
 * @Author: 高月飞
 * @Date: 2023-11-18 09:43:58
 * @LastEditors: 高月飞
 * @LastEditTime: 2023-11-23 19:37:05
-->
<template>
    <div class="leftIcon">
        <i class="iconfont icon-zhuye iconStylus" @click="getHome"></i>
        <i class="iconfont icon-shuaxin iconStylus" @click="refresh"></i>
        <i class="iconfont icon-bangzhu iconStylus"></i>
    </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";
import { defineProps } from 'vue';

interface IProps {
    isHomePage: boolean;
    setHomePage: (value: boolean) => void;
}

const { isHomePage, setHomePage } = defineProps<IProps>();
const router = useRouter();

const getHome = () => {
    // 委托修改逻辑给父组件
    setHomePage(false);
    router.replace('/dashoard/newData')
}
const refresh = () => {
    const currentRoute = router.currentRoute.value;
    // window.location.reload(currentRoute.fullPath);
    router.go(0);
}
</script>


<style lang="scss" scoped>
.leftIcon {
    width: 250px;
    display: flex;
    justify-content: space-between;

    :nth-child(1) {
        margin-left: 20px;
    }
}

.iconStylus {
    font-size: 30px;
}
</style>